package com.ss.android.article.base.feature.app;

import android.app.Activity;
import android.app.Dialog;
import android.content.Context;
import android.support.v4.content.ContextCompat;
import android.view.MotionEvent;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.TextView;
import com.ss.android.article.base.app.AppData;
import com.ss.android.article.browser.R;
import com.ss.android.common.lib.MobClickCombiner;

public final class ee extends Dialog implements View.OnTouchListener {
    public ImageView a;
    public TextView b;
    public TextView c;
    public TextView d;
    Context e;
    String f;
    private FrameLayout g;
    private TextView h;

    public ee(Context arg4, String arg5) {
        super(arg4, R.style.ef);
        this.setContentView(com.ss.android.article.browser.R.layout.h_);
        this.e = arg4;
        this.f = arg5;
        this.g = this.findViewById(com.ss.android.article.browser.R.id.root);
        this.a = this.findViewById(com.ss.android.article.browser.R.id.top_image);
        this.b = this.findViewById(com.ss.android.article.browser.R.id.content_title);
        this.c = this.findViewById(com.ss.android.article.browser.R.id.content_text);
        this.h = this.findViewById(com.ss.android.article.browser.R.id.dialog_cancel);
        this.d = this.findViewById(com.ss.android.article.browser.R.id.dialog_confirm);
        this.h.setOnClickListener(new f(this));
        AppData.getInstance();
        boolean v0 = AppData.isNightMode();
        this.g.setBackgroundResource(com.ss.android.article.browser.R.drawable.background_permission_dialog_2);
        ImageView v1 = this.a;
        float v0_1 = v0 ? 0.5f : 1f;
        v1.setAlpha(v0_1);
        this.b.setTextColor(ContextCompat.getColor(this.e, R.color.ssxinzi1));
        this.c.setTextColor(ContextCompat.getColor(this.e, R.color.ssxinzi3));
        this.h.setTextColor(ContextCompat.getColor(this.e, R.color.ssxinzi2));
        this.d.setTextColor(ContextCompat.getColor(this.e, R.color.update_comment_more_text_selector));
        this.h.setOnTouchListener(((View.OnTouchListener)this));
        this.d.setOnTouchListener(((View.OnTouchListener)this));
        this.setCanceledOnTouchOutside(true);
    }

    final void a() {
        if(((this.e instanceof Activity)) && !((Activity)this.e).isFinishing() && (this.isShowing())) {
            this.dismiss();
        }
    }

    public final boolean onTouch(View arg2, MotionEvent arg3) {
        switch(arg3.getAction()) {
            case 0: {
                arg2.setAlpha(0.5f);
                break;
            }
            case 1: 
            case 3: {
                arg2.setAlpha(1f);
                break;
            }
        }

        return false;
    }

    public final void show() {
        super.show();
        MobClickCombiner.onEvent(this.e, "pop", this.f + "_show");
    }
}

